import request from '@/utils/request';
import { Page, AccInfo, TestType, Del } from "./apitype"

//首页
export const $deviceCount = () => request.get('/device/count');
export const $sensorCount = () => request.get('/sensor/count');
export const $EquipmentData = () => request.get('/device/sensorList')
//设备
export const $GatewayData = (params: Page) => request.get('/gateway/list', { params })
export const $SensorData = (params: Page) => request.get('/sensor/list', { params })
export const $DeviceData = (params: Page) => request.get('/group/list', { params })
export const $AddGroup = (data: Page) => request.post('/group/add', data)//添加群组
export const $DelGroup = (data: Del) => request.post('/group/del', data)//删除群组
export const $GroupDetail = (data: any) => request.post('/group/detail', data)//群组详情
export const $EditGroup = (data: Del) => request.post('/group/edit', data)//修改群组
// 计费
export const $GetPayData = (params: Page) => request.get('/fee/rechargeList', { params })
export const $GetUseData = (params: Page) => request.get('/fee/usageList', { params })
export const $Balance = () => request.get('/fee/balance')//账户余额
export const $AccInfo = (data: any) => request.post('/fee/recharge', data)//账户信息
// 测量类型
export const $GetTypeListData = (params: Page) => request.get('/measurement/list', { params })
export const $AddType = (data: TestType) => request.post('/measurement/add', data)//添加测量类型
export const $DelType = (data: Del) => request.post('/measurement/del', data)//删除测量类型
export const $EditType = (data: any) => request.post('/measurement/edit', data)//修改测量类型
export const $TypeDetail = (data: any) => request.post('/measurement/detail', data)//详情
// 安全
export const $GetKeyListData = (params: Page) => request.get('/security/list', { params })
export const $AddKeyFn = (data: any) => request.post('/security/add', data)//添加密钥
export const $DelKeyFn = (data: Del) => request.post('/security/del', data)//删除密钥
export const $EidtKeyFn = (data: any) => request.post('/security/edit', data)//修改密钥
export const $KeyDetail = (data: any) => request.post('/security/detail', data)//修改密钥
// 账号
export const $GetAccListData = (params: Page) => request.get('/account/list', { params })
export const $AddAccount = (data: AccInfo) => request.post('/account/add', data)//添加账号
export const $DelAccount = (data: Del) => request.post('/account/del', data)//删除账号